package com.example.entity;

import java.util.Date;

/**
 * 用户实体类
 * 对应数据库中的t_user表
 */
public class User {
    private Integer id;          // 用户ID
    private String name;        // 用户名
    private String email;       // 邮箱
    private Integer age;        // 年龄
    private Date createTime;    // 创建时间
    private Date updateTime;    // 更新时间

    // 无参构造方法（MyBatis需要）
    public User() {
    }

    // 全参构造方法
    public User(Integer id, String name, String email, Integer age,
                Date createTime, Date updateTime) {
        this.id = id;
        this.name = name;
        this.email = email;
        this.age = age;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    // Getter和Setter方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", email='" + email + '\'' +
                ", age=" + age +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}